<template>
	<view style="height: 400rpx">
		<l-echart ref="chart"></l-echart>
	</view>
</template>

<script>
	import * as echarts from 'echarts';
	export default {
		data() {
			return {
			}
		},
		mounted() {
			this.$refs.chart.init(echarts, chart=> {
				let option = {
					tooltip: {
						trigger: 'item'
					},
					legend: {
						bottom: 'bottom',
						left: 'center'
					},
					grid:{
						bottom:"20%"
					},
					series: [
						{
							name: '1',
							type: 'pie',
							radius: ['40%', '60%'],
							avoidLabelOverlap: false,
							label: {
								show: false,
								position: 'center'
							},
							emphasis: {
								label: {
									show: true,
									fontSize: '40',
									fontWeight: 'bold'
								}
							},
							labelLine: {
								show: false
							},
							data: [
								{value: 1048, name: '搜索引擎'},
								{value: 735, name: '直接访问'},
								{value: 580, name: '邮件营销'}, 
							]
						}
					]
				}
				chart.setOption(option);
				
			});
		}
	}
</script>